import {createStore,applyMiddleware} from "redux";
import reducer from "./reducer.js";

import { createLogger } from 'redux-logger';
import thunk from 'redux-thunk';

var logger = new createLogger();

var state={
	headerTitle:"卖座电影",
	isToggle:false,
	getMainData1:[],
	getMainData2:[],
	getNowPlayData1:[],
	getWillPlayData:[],
	cinemaData:[],
	loadPageData:"",
	detailData:[],
	userMsg:'',
	scrollNum:0,
	isShow:true
}
console.log(state);
var store = createStore(reducer,state,applyMiddleware(thunk,logger));

store.createAction = function(action) {

    // store.dispath 本来接收的参数是【表情】  action
    // 我们引用了  redux-thunk 中间件之后，使得， dispatch 可以接受 方法了
    // store.dispatch(action);
    store.dispatch(action)
}


export default store;